#include <REGX52.H>
#include "Delay.h"
#include "MatrixLED.h"

//动画数组
//code 只读的存储空间，不可以更改，但存储空间比RAM更大
unsigned char code Animation[] = 
{
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0xFF,0x08,0x08,0x08,0xFF,0x00,0xFF,0x89,
	0x89,0x89,0x89,0x00,0xFF,0x01,0x01,0x01,
	0x01,0x00,0xFF,0x01,0x01,0x01,0x01,0x00,
	0xFF,0x81,0x81,0x81,0xFF,0x00,0xFB,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
void main()
{
	unsigned char i,Offset=0,Count=0;;//Offset 偏移量
	MatrixLED_Init();
	while(1)
	{
		for(i=1;i<=8;i++)
		{			
			MatrixLED_ShowColumn(i,Animation[i-1+Offset]);		
		}
		Count++;
		if(Count>10)//做延时
		{
			Count = 0;
			Offset++;//偏移量加一
		}
		if(Offset>40) //如果（i-1+Offset）>47了归零
		{
			Offset = 0;
		}
		
	}
}